import {createBrowserRouter} from 'react-router-dom'
import Index from '../pages/index/Index'
import Detail from '../pages/detail/Index'
import Form from '../pages/form/Index'
import Iconn from '../pages/iconn/Index'
import List from '../pages/list/Index'
import Login from '../pages/login/Index'
import Search from '../pages/search/Index'
import Xt from '../pages/xt/Index'
import Cd from '../pages/xt/cd/Index'
import Qxlb from '../pages/xt/qxlb/Index'
import User from '../pages/xt/user/Index'
import Error from '../pages/404/Index'
export const homerouter=[
    {
        path:"/index/list",
        title:"卡片列表",
        element:<List></List>
    },
    {
        path:"/index/search",
        title:"查询列表",
        element:<Search></Search>
    },
    {
        path:"/index/detail",
        title:"详情页",
        element:<Detail></Detail>
    },
    {
        path:"/index/form",
        title:"表单页面",
        element:<Form></Form>
    },
    {
        path:"/index/iconn",
        title:"图标库",
        element:<Iconn></Iconn>
    },
    {
        path:"/index/xt",
        title:"系统管理",
        element:<Xt></Xt>,
        children:[
            {
                path:"/index/xt/qxlb",
                title:"权限类别",
                element:<Qxlb></Qxlb>
            },
            {
                path:"/index/xt/cd",
                title:"菜单管理",
                element:<Cd></Cd>
            },
            {
                path:"/index/xt/user",
                title:"用户管理",
                element:<User></User>
            },
        ]
    },
]
const router =createBrowserRouter([
    {
        index:true,
        element:<Index></Index>
    },
    {
        path:"index",
        element:<Index></Index>,
        children:homerouter
    },
    {
        path:"login",
        element:<Login></Login>
    },
    {
        path:"*",
        element:<Error></Error>
    }
])
export default router;